#include <iostream>

using namespace std;
const int N = 1010;

int f[N];

int main()
{
    int n;
    cin >> n;
    int mod = 1e9;
    for (int i = 1; i <= n; ++i)
    {
        for (int j = 1; j <= n; ++j)
        {
            // f[i][j] = f[i - 1][j] + f[i - 1][j - i] + f[i - 1][j - 2i] + ... f[i][j - s*i];
            // f[i][j - i] =
            f[j] = (f[j] + f[j - i]) % mod;
        }
    }

    cout << f[n] << endl;
    return 0;
}